package com.common.util;

import java.math.BigDecimal;
import java.text.DecimalFormat;

/**
 * @describe: 金额工具
 */
public class MoneyUtil {

    public static String moneyFormat (final BigDecimal amount) {
        DecimalFormat df = new DecimalFormat("###0.00");
        return df.format(amount);
    }

    public static String moneyFormatPage (final BigDecimal amount) {
        DecimalFormat df = new DecimalFormat("#,##0.00");
        return df.format(amount);
    }

    public static BigDecimal strToMoney(String money){
        BigDecimal decimal = new BigDecimal(money);
        return decimal;
    }

}
